]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
location: Don't show menu if geoclue is totally incapable
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sat, 15 Feb 2014 15:46:07 +0000 (15:46 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sat, 15 Feb 2014 17:41:26 +0000 (17:41 +0000)
If geoclue can't provide location at all (no GPS or network), don't
bother to show controls that don't serve any purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=723684

js/ui/status/location.js

index d83aaf6751f5019ef5af4c33f52ba199e0fa21f1..7f68b366bdfc594339d88b7502ee865777b62c9d 100644 (file)
@@ -127,6 +127,7 @@ const Indicator = new Lang.Class({
         if (!this._availableAccuracyLevel) {
             this._availableAccuracyLevel = this._proxy.AvailableAccuracyLevel;
             this._maxAccuracyLevel = this._availableAccuracyLevel;
+            this._updateMenuVisibility();
         }
 
         this._syncIndicator();
@@ -183,6 +184,10 @@ const Indicator = new Lang.Class({
         var variant = new GLib.Variant('u', this._maxAccuracyLevel);
         this._agent.emit_property_changed ('MaxAccuracyLevel', variant);
         this._userSetAccuracy = false;
+    },
+
+    _updateMenuVisibility: function() {
+        this.menu.actor.visible = (this._availableAccuracyLevel != 0);
     }
 });